<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .img{
            width: 100px;
        }
        .imgs{
            width: 200px;
        }
    </style>
</head>
<body>
    <div id="root">

    </div>
</body>
<script src="../react.js"></script>
<script src="../react-dom.js"></script>
<script src="https://cdn.staticfile.org/babel-standalone/6.26.0/babel.min.js"></script>
<script type="text/babel">
    let href = 'http://www.baidu.com'
    let url = '';
    let title = '加载失败'
    let isImg = false;
    let style = {
        color:"blue",
        height:"40px",
        lineHeight:"40px",
        backgroundColor:"black"
    }
   let div = (
    <div>
        {
                // jsx中类名使用 className定义
            }
        <h1 className={isRed?r:cn}> 好好学习天天向上</h1>   
        <a href={href}>百度一下</a>
        {
            // jsx中标签必须有结束标签
        }
        <img src={url} alt={title} className={isImg?'img':'imgs'}/>  
        {
            // 绑定样式
        }
        <div style={{
            color:"red",
            fontSize:"30px"
        }}>好好学习天天向上</div>
        <div style={style}> 学习使我快乐 </div>
    </div>
   )

   ReactDOM.render(div,document.getElementById("root"))
</script>
</html>